import socket

def client():
    client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    client.connect(("127.0.0.1",8000))

    while True:
        msg=input()
        client.send(msg.encode("utf-8"))
        ret_msg = client.recv(1024).decode("utf-8")
        print(ret_msg)
        if ret_msg == "bye":
            client.close()
            return



if __name__ == "__main__":
    client()